/**
 * 
 */
package demo.tellurium.test;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import demo.tellurium.framework.BaseTelluriumJUnitTestCase;
import demo.tellurium.module.CQPModule;

/**
 * @author roger.xu
 * 
 */
public class CQPModuleJUnitTestCase extends BaseTelluriumJUnitTestCase {
    private static CQPModule cqp;

    @BeforeClass
    public static void initUi() {
        cqp = new CQPModule();
        cqp.defineUi();
    }

    @Before
    public void connectTo() {
        connectUrl(cqp.url);
    }

    @Test
    public void testLogin() {
        console.debug("[testLogin]");
        // cqp.doAdminLogin();
        cqp.doLogin("xshai@cn.ibm.com", "aaaa");
    }

    @Test
    public void testSearch() {
        console.debug("[testSearch]");
        waitingDelay();

        cqp.doSearch("*");
        pauseSec(5);
    }

    @Test
    public void testExpandCell() {
        console.debug("[testExpandCell]");
        waitingDelay();

        cqp.doClickCheckBox();
        pauseSec(1);

        cqp.doExpandCell();
        pauseSec(2);

        cqp.doExpandCell();
        pauseSec(2);

        cqp.doExpandCell();
        pauseSec(5);
    }

    @Ignore
    @Test
    public void testClickCheckBox() {
        console.debug("[testClickCheckBox]");
        waitingDelay();

        cqp.doClickCheckBox();
        pauseSec(1);
        cqp.doClickCheckBox();
        pauseSec(1);
        cqp.doClickCheckBox();
        pauseSec(1);
    }

    @Ignore
    @Test
    public void testClickAdvancedSearch() {
        console.debug("[testClickAdvancedSearch]");
        waitingDelay();

        cqp.doClickAdvancedSearch();
        pauseSec(1);
        cqp.doClickAdvancedSearch();
        pauseSec(1);
        cqp.doClickAdvancedSearch();
        pauseSec(1);
    }

    @Ignore
    @Test
    public void testClickCreateButton() {
        console.debug("[testClickCreateButton]");
        waitingDelay();

        cqp.doClickCheckBox();
        pauseSec(1);

        cqp.doClickCreateButton();
        pauseSec(1);
    }

    @Ignore
    @Test
    public void testClickOpenButton() {
        console.debug("[testClickOpenButton]");
        waitingDelay();

        cqp.doClickCheckBox();
        pauseSec(1);

        cqp.doClickOpenButton();
        pauseSec(1);
    }

    @Test
    public void testClearResult() {
        console.debug("[testClearResult]");
        waitingDelay();

        cqp.doClearResult();
    }

    @Test
    public void testClickDeleteButton() {
        console.debug("[testClickDeleteButton]");
        waitingDelay();

        cqp.doClickCheckBox();
        pauseSec(1);

        cqp.doClickDeleteButton();
        pauseSec(5);
    }

}
